﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.IO;

public partial class Pages_Admin_upfile :NoTheme
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        try
        {
            string filePath = UpLoad1.FullPath;
            filePath = filePath.Replace('\\', '/');
            filePath = filePath.Replace("//", "/");

            Label1.Text =string.Format("http://{0}",Request.Url.Host+filePath);

        }
        catch (Exception ex)
        {
            Pan.Common.MessageBox.Show(this,ex.Message);
        }
    }


    #region

    /// <summary>
    ///panbbb CreatePath
    /// </summary>
    /// <param name="_path">Relateive Path</param>
    /// <returns>return Created state true or false</returns>
    protected static bool CreatePath(string _path)
    {
        bool yesOrno = true;
        try
        {
            string jia = HttpContext.Current.Server.MapPath(string.Format("{0}", _path));
            if (!Directory.Exists(jia))
            {
                Directory.CreateDirectory(jia);
                //   DirectoryInfo di = Directory.CreateDirectory(jia);
            }
        }
        catch (Exception ex)
        {
            throw ex;
        }
        return yesOrno;

    }
    #endregion
}

